﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using CapaPresentacion.ValidationRules;

namespace CapaPresentacion.Controles
{
    /// <summary>
    /// Lógica de interacción para LabelAndTextBoxWithValidation.xaml
    /// </summary>
    public partial class LabelAndTextBoxWithValidation : UserControl
    {

        public static readonly DependencyProperty TextoProperty = DependencyProperty.Register("Texto", typeof(string), typeof(LabelAndTextBoxWithValidation));


        public LabelAndTextBoxWithValidation()
        {
            InitializeComponent();

            this.DataContext = this;

            
        }


        public int Longitud
        {
            set { txt.MaxLength = value; }
        }

        public string Etiqueta
        {
            get { return lbl.Content.ToString(); }

            set { lbl.Content = value; }
        }

        public string Texto
        {
            get { return (string)GetValue(TextoProperty); }
            set { SetValue(TextoProperty, value); }
        }

      

    }
}
